<!--
 * @Descripttion: 文章详情
 * @version: 
 * @Author: 
 * @Date: 2022-04-24 08:59:45
 * @LastEditors: weidelong
 * @LastEditTime: 2022-04-24 11:02:21
-->
<template>
	<div class="detailPage">
		<van-nav-bar left-arrow @click-left="onClose" />
		<div class="container1">
			<h3>{{title}}</h3>
			<div class="time">
				<span>{{author}}&nbsp;&nbsp;&nbsp;</span>
				<span>{{time}}</span>
			</div>
			<div class="content" v-html="content"></div>
		</div>
	</div>
</template>

<script>
	export default {
		name: 'detailPage',
		data() {
			return {
				title: '',
				author: '',
				time: '',
				content: ''
			}
		},
		created() {
			this.getParams()
		},
		methods: {
			onClose() {
				this.$router.push({path: '/home'})
			},
			getParams() {
				const data = JSON.parse(this.$route.params.data)
				this.title = data.title
				this.author = data.author
				this.time = data.addTime
				this.content = data.content
			}
		},
	}
</script>

<style lang="scss" scoped>
	.detailPage {
		width: 100%;
		overflow: hidden;
		box-sizing: border-box;
		padding-bottom: 50px;
		background-color: #fff;
		position: absolute;
		z-index: 99;
		.container1 {
			padding: 10px;
			.time {
				margin: 10px 0;
				font-size: 14px;
				color: #999;
			}
			.content {
				::v-deep p {
					font-size: 14px;
					color: #666;
				}
				::v-deep img {
					width: 90%;
					height: 80%;
					position: relative;
					margin-left: 50%;
					padding: 5% 0;
					transform: translate(-50%, 0);
				}
			}
		}
	}
	
</style>